package
{
	import org.flixel.*; 	

	public class SplashState extends FlxState	
	{	
		protected var t2:FlxText; 
		
		override public function create():void
		{	
			//Backgrounds
			var b0:FlxSprite = new FlxSprite(0,0);
			b0.loadGraphic(Resources.Back0,false);
			add(b0);
			
			var t:FlxText = new FlxText((FlxG.width / 2 ) - 280 , 120 , FlxG.width,"CV's Invaders");
			t.size = 40;
			t.flicker(200);
			t.alignment = "center";
			add(t);
			
			var t2:FlxText = new FlxText(4,FlxG.height - 44,FlxG.width,"Click to start!");
			t2.alignment = "center";
			t2.flicker(100);
			t2.size = 20;
			add(t2);
	
			var l1:FlxText = new FlxText(0,200,FlxG.width,"1 - Ninja Coder");
			l1.alignment = "center";
			l1.size = 15;
			add(l1);
			var l2:FlxText = new FlxText(0,230,FlxG.width,"2 - Android tester");
			l2.alignment = "center";
			l2.size = 15;
			add(l2);
			var l3:FlxText = new FlxText(0,260,FlxG.width,"3 - Tux Admin");
			l3.alignment = "center";
			l3.size = 15;
			add(l3);
			var l4:FlxText = new FlxText(0,290,FlxG.width,"4 - Manager Guy");
			l4.alignment = "center";
			l4.size = 15;
			add(l4);
			
			
			
			FlxG.mouse.show();
		}
		
		override public function update():void
		{
	
			if(FlxG.keys.justPressed("ONE")) {
				FlxG.mouse.hide();
				FlxG.state = new PlayCvInvaderState(1);
				return;	
			}
			if(FlxG.keys.justPressed("TWO")) {
				FlxG.mouse.hide();
				FlxG.state = new PlayCvInvaderState(2);
				return;	
			}
			if(FlxG.keys.justPressed("THREE")) {
				FlxG.mouse.hide();
				FlxG.state = new PlayCvInvaderState(3);
				return;	
			}
			if(FlxG.keys.justPressed("FOUR")) {
				FlxG.mouse.hide();
				FlxG.state = new PlayCvInvaderState(4);
				return;	
			}
		}

	}
}
